﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LookUpLater
{
    public class LinkedCustomList<T>
    {
        public List<T> ItemList;
        public LinkedCustomList(List<T> list)
        {
            this.ItemList = list;
            CustomList<T>.list = list;
        }
        public CustomList<T> First
        {
            get
            {
                return new CustomList<T>(0);
            }
        }
    }
    public class CustomList<T>
    {
        public static List<T> list;
        public CustomList<T> previousNode
        {
            get
            {
                return new CustomList<T>(CurrentIndex - 1);
            }
        }
        public CustomList<T> nextNode
        {
            get
            {
                return new CustomList<T>(CurrentIndex + 1);
            }
        }
        public T Value
        {
            get
            {
                return list.ElementAtOrDefault(CurrentIndex);
            }
        }
        public int CurrentIndex { get; private set; }
        public CustomList(int currentIndex)
        {
            this.CurrentIndex = currentIndex;
        }
    }
}
